package com.qzsoft.zhjd.home.v2.dto;

import java.math.BigDecimal;
import java.util.List;

import lombok.Data;
import lombok.ToString;

/**
 * @ClassName MaterielCountDto
 * @Description 收发料统计
 * @author linhuawei
 * @since 2022-08-17
 */
@Data
@ToString
public class MaterielCountDto {

    /**
     * 总重量
     */
    private BigDecimal total;

    /**
     * 各类型数据
     */
    private List<MaterielDateTypeCountDto> list;

    public void countTotal() {
        total = BigDecimal.ZERO;
        if (null != list) {
            for (MaterielDateTypeCountDto dto : list) {
                if (null != dto.getValue()) {
                    total = total.add(dto.getValue());
                }
            }
        }
    }

}
